<template>
  <div>
    <button  :style="{color:obj.color}" @click="send()">{{obj.title}}</button>
    <button  @click="modify()">sync按钮</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      name:'我是按钮'
    }
  },
  props: {
    title: {
      type: String,
      default:"按钮"
    },
    obj: {
      title: {
        type: String,
        default:"按钮"
      },
      color: String,
      padding: String
    },
    event: {
      type:Function // 父组件的方法
    }
  },
  methods: {
    send() {
      this.$emit('e-child', this.event)//通过'e-child' 发射到父组件
    },
    modify() {
      this.$emit('update:parentName',"SYNC异步值")//通过'e-child' 发射到父组件
    },
    hander() {
      console.log(123);
    }
  }
}
</script>

<style>

</style>
